<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">文章:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-article_id" data-rule="required" data-source="article/article/index" data-field="title"
            class="form-control selectpage" name="row[article_id]" type="text" value="{$row.article_id|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-title" data-rule="required" class="form-control " rows="5" name="row[title]" cols="50">{$row.title|htmlentities}</textarea>
        </div>
    </div>
    <!-- <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-content" data-rule="required" class="form-control editor" rows="5" name="row[content]" cols="50">{$row.content|htmlentities}</textarea>
        </div>
    </div> -->
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Type')}:</label>
        <div class="col-xs-12 col-sm-8">
                        
            <select  id="c-type" data-rule="required" class="form-control selectpicker" name="row[type]">
                {foreach name="typeList" item="vo"}
                    <option value="{$key}" {in name="key" value="$row.type"}selected{/in}>{$vo}</option>
                {/foreach}
            </select>

        </div>
    </div>
    <!-- <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Values')}:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-values" data-rule="required" class="form-control " rows="5" name="row[values]" cols="50">{$row.values|htmlentities}</textarea>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Answer')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-answer" data-rule="required" class="form-control" name="row[answer]" type="text" value="{$row.answer|htmlentities}">
        </div>
    </div> -->

    <div class="form-group" hidden>
        <label class="control-label col-xs-12 col-sm-2">{:__('Values')}:</label>
        <div class="col-xs-12 col-sm-8">
			<dl class="fieldlist" data-template="itembanktpl" data-name="row[values]">
                <dd>
					
                    <ins>选项</ins>
                    <ins style="width:300px">选项内容</ins>
					<ins style="width:30px">{:__('答案')}</ins>
                </dd>
                <dd><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> {:__('Append')}</a></dd>
                <textarea id="c-values" name="row[values]" class="form-control hide" cols="30" rows="5">{$row.values}</textarea>
            </dl>
            <script id="itembanktpl" type="text/html">
                <dd class="form-inline">  
                    <ins><input type="text" name="<%=name%>[<%=index%>][key]" class="form-control" value="<%=row.key%>" placeholder="选项"/></ins>
                    <ins style="width:300px"><input style="width:300px" type="text" name="<%=name%>[<%=index%>][value]" class="form-control" value="<%=row.value%>" placeholder="选项内容"/></ins>
					<ins style="width:30px"><input style="width:30px" type="checkbox" name="<%=name%>[<%=index%>][answer]" value="checked" {php}echo "<%=row.answer%>";{/php} /></ins>
                    <span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span>
                    <span class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span>
                </dd>
            </script>
        </div>
    </div>
    <div class="form-group" hidden>
        <label class="control-label col-xs-12 col-sm-2">判断题答案:</label>
        <div class="col-xs-12 col-sm-8">
			<div class="radio" id="c-judge_answer">
                <label for="row[judge_answer]-0"><input id="row[judge_answer]-0" name="row[judge_answer]" type="radio" value="0" {in name="row['answer']" value="0"}checked{/in}> 错误</label> 
                <label for="row[judge_answer]-1"><input id="row[judge_answer]-1" name="row[judge_answer]" type="radio" value="1" {in name="row['answer']" value="1"}checked{/in}> 正确</label> 
            </div>
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Answer_key')}:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-answer_key"  class="form-control " rows="5" name="row[answer_key]" cols="50">{$row.answer_key|htmlentities}</textarea>
        </div>
    </div>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
